package com.demo.rocketmq;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@Slf4j
public class Producer {

    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @GetMapping("/sendMsg")
    public void sendMsg() throws Exception {
        Message message = new Message("wangfeng","*","hello world".getBytes());
        rocketMQTemplate.getProducer().send(message);
        log.info("send success");
    }

    public static void main(String[] args) {
        Integer x = Integer.parseInt("12",16);
        System.out.println(x);

    }

}
